<?php
	function toJson($jsonstr, $html_format = false){
		$json = json_encode($jsonstr);
		if($html_format){
			$json = htmlspecialchars($json, ENT_NOQUOTES, 'utf-8');
		}
		return $json;
	}
?>